{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<script type="text/javascript">
	$(document).ready(function(){
		$("#typeSelect").bind("change",function(){
	
			$(".type").hide();
			$(".type_" + $(this).val()).show();

		});
		
		$("#pageSelect").bind("change",function(){
			if ($(this).val() == "top"){
				$(".type_top").show();
				$("#data_label").html("文章ID号:");
			}else{
				$(".type_top").hide();
				$("#data_label").html("贷款ID号:");
			}		
						
		});	
		
		$(".type").hide();
		$(".type_" + $("#typeSelect").val()).show();
		
		if ($("#pageSelect").val() == "top"){
			$(".type_top").show();
			$("#data_label").html("文章ID号:");
		}else{
			$(".type_top").hide();
			$("#data_label").html("贷款ID号:");
		}
	});

</script>
<div class="main">
<div class="main_title">{%ADD} <a href="{:u("MAdv/index")}" class="back_list">{%BACK_LIST}</a></div>
<div class="blank5"></div>
<form name="edit" action="__APP__" method="post" enctype="multipart/form-data">
<table class="form" cellpadding=0 cellspacing=0>
	<tr>
		<td colspan=2 class="topTd"></td>
	</tr>
	<tr>
		<td class="item_title">{%NAME}:</td>
		<td class="item_input">
			<input type="text" class="textbox require" name="name"  />
		</td>
	</tr>
	<tr>
		<td class="item_title">{%ADV_PAGE}:</td>
		<td class="item_input">
			<select name="page"  id='pageSelect'>
				<option value="top">首页广告</option>
				<option value="deal">首页借款单</option>
			</select>
		</td>
	</tr>
	
	<tr class="type_top">
		<td class="item_title">{%ADV_IMAGE}:</td>
		<td class="item_input">
			<html:imgUpload name = 'img' id='img' />
			<span class='tip_span'>[{%ADV_PAGE_TIPS}]</span>
		</td>
	</tr>
	
	<tr class="type_top">
		<td class="item_title">{%ADV_TYPE}:</td>
		<td class="item_input">
			<select name="type" id='typeSelect'>
				<option value="1">文章ID号</option>
				<option value="2">URL连接</option>
			</select>
		</td>
	</tr>
	
	<tr class="type_1 type" >
		<td id="data_label" class="item_title">数据ID:</td>
		<td class="item_input">
			<input type="text" class="textbox " name="data_id"  />
		</td>
	</tr>
		
	<tr class="type_2 type" style="display:none;">
		<td class="item_title">{%URL}:</td>
		<td class="item_input">
			<input type="text" class="textbox " name="url"  />
			<span class='tip_span'>需要带：http:// 格式的url连接地址</span>
		</td>
	</tr>
	
	<tr class="type_2 type" style="display:none;">
		<td class="item_title">使用外置浏览器</td>
		<td class="item_input">
			<select name="open_url_type">
				<option value="0">否</option>
				<option value="1">是</option>
			</select>
		</td>
	</tr>
	


	<tr>
		<td class="item_title">{%SORT}:</td>
		<td class="item_input">
			<input type="text" class="textbox " name="sort" value="{$new_sort}"  />
		</td>
	</tr>	
	<tr>
		<td class="item_title"></td>
		<td class="item_input">
			<!--隐藏元素-->
			<input type="hidden" name="{:conf("VAR_MODULE")}" value="MAdv" />
			<input type="hidden" name="{:conf("VAR_ACTION")}" value="insert" />
			<!--隐藏元素-->
			<input type="submit" class="button" value="{%ADD}" />
			<input type="reset" class="button" value="{%RESET}" />
		</td>
	</tr>
	<tr>
		<td colspan=2 class="bottomTd"></td>
	</tr>
</table>	 
</form>
</div>
<include file="Public:footer" />